<?

class CDate{
    static public $format = "j F H:i";

    private $timestamp;
    public function __construct($datetime = "now"){
        if(is_numeric($datetime)){
            $this->timestamp = $datetime;
        }
        else{
            $this->timestamp = strtotime($datetime);
        }
    }

    public function getTimestamp(){
        return $this->timestamp;
    }

    public function format($format = false){
        if($format == false) $format = self::$format;
        return Rus::date($format,  $this->timestamp);
    }

    public function __toString(){
        return $this->format();
    }


}

?>